#Author:Jason Song
class Skill:
    def __init__(self,res):
        acc = int(res["jiasu"])
        #技能基础伤害，技能系数，武伤系数，伤害秘籍+套装伤害+奇穴增伤，会心秘籍+会心奇穴，会效奇穴,GCD,CD,名称]
        self.shang = [389,1.0421,0,0,0,0,1.5,0,"商陆缀寒"]
        if res["shangku"] == "2": #沾衣未妨伤裤附魔
            self.zhan = [130, 0.7816, 0, 0, 0, 0, 0.75, 20, "沾衣未妨"]
        else:
            self.zhan = [130,0.7816,0,0,0,0,0.75,20,"沾衣未妨"]
        self.xi = [149,1.0839,0,0,0,0,0.625,10,"川乌射罔"] # 21.11.08削弱
        # self.xi = [149, 0.9213, 0, 0, 0, 0, 0.625, 10, "川乌射罔"]
        self.gou = [119,0.6253,0,0,0,0,1.5,0,"钩吻断肠"]
        # self.wu = [105,0.917,0,0,0,0,0,0, "无方中和"] #2021.12.13削弱
        self.wu = [105, 0.8334, 0, 0, 0, 0, 0, 0, "无方中和"]
        self.qie = [211, 0.6723, 0, 0, 0, 0, 1, 47, "且待时休"]
        self.ni = [95,0.113,0,0,0,0,2,0, "逆乱"]
        self.cang = [142, 1.5632, 0, 0, 0, 0, 1, 25, "苍棘缚地"]
        self.yin = [420, 0.625, 0, 0, 0, 0, 1.4375, 10, "银光照雪"]
        self.jing = [163, 0.521, 0, 0, 0, 0, 1.5, 30, "惊鸿掠水"]
        self.hui = [0, 0, 0, 0, 0, 0, 1, 30, "回风微澜"]
        self.han = [585, 1.678, 0, 0, 0, 0, 1.5, 20, "含锋破月"]
        self.fei = [635, 2.03, 0, 0, 0, 0, 1.5, 20, "飞叶满襟"]
        if res["qixue_10"] == "1":  # 紫伏
            self.zi = [36, 0.974, 0, 0, 0, 0, 0, 0, "紫叶"]
        if res["qixue_5"] == "2":  # 沉疴
            self.zi_li = [425, 0.989, 0, 0, 0, 0, 1.5, 36, "沉疴"]
        if res["qixue_9"] == "2":  # 疾根
            # self.ji = [125, 0.8862, 0, 0, 0, 0, 0, 0, "疾根"] #2022-01-17削弱
            self.ji = [125, 0.4431, 0, 0, 0, 0, 0, 0, "疾根"]
        self.po = [16.7486,0,0,0,0,0,2,0,"破"] #北天药宗14.504→15.226→16.7486
        self.pozhao = float(res["pozhao"])
        self.po[0] = self.po[0] * self.pozhao
        # self.feijian = [1500,0,0,0,0,0,0,0,"剑风"]
        self.shou = [0, 0.7907, 0, 0, 0, 0, 0, 10, "手附魔"]
        self.piao = [58, 1.2857, 0, 0, 0, 0, 1.5, 0, "飘黄"]
        if "jiayuanjiu" in res:
            if res["jiayuanjiu"] == "2":
                acc += 111
            elif res["jiayuanjiu"] == "3":
                acc += 333
            elif res["jiayuanjiu"] == "4":
                acc += 444
            else:
                pass
        if "zengqiangyaopin" in res:
            if res["zengqiangyaopin"] == "7":
                acc += 991

        if res["ping"] == 2:
            self.shang[6] += 0.0625
            self.gou[6] += 0.125
            self.zi[6] += 0.125

        elif res["ping"] == 3:
            self.shang[6] += 0.1875
            self.gou[6] += 0.1875
            self.zi[6] += 0.1875

        elif res["ping"] == 4:
            self.shang[6] += 0.25
            self.gou[6] += 0.25
            self.zi[6] += 0.25
        if acc >= 43:
            self.shang[6] -= 0.0625
            self.gou[6] -= 0.0625
            self.zi[6] -= 0.0625
            self.po[6] -= 0.0625
            self.xi[6] -= 0.0625
            self.ni[6] -= 0.0625
            self.cang[6] -= 0.0625
            if acc >= 1457:
                self.po[6] -= 0.0625
                self.ni[6] -= 0.0625
                if acc >= 1928:
                    self.shang[6] -= 0.0625
                    self.gou[6] -= 0.0625
                    self.zi[6] -= 0.0625
                    if acc >= 2956:
                        self.po[6] -= 0.0625
                        self.ni[6] -= 0.0625
                        self.cang[6] -= 0.0625
                        if acc >= 4026:
                            self.shang[6] -= 0.0625
                            self.gou[6] -= 0.0625
                            self.zi[6] -= 0.0625
                            if acc >= 4540:
                                self.po[6] -= 0.0625

                                self.ni[6] -= 0.0625
                                if acc >= 4883:
                                    self.xi[6] -= 0.0625
                                    if acc >= 6296:
                                        self.shang[6] -= 0.0625
                                        self.gou[6] -= 0.0625
                                        self.zi[6] -= 0.0625
                                        self.po[6] -= 0.0625

                                        self.ni[6] -= 0.0625
                                        self.cang[6] -= 0.0625
                                        if acc >= 8138:
                                            self.po[6] -= 0.0625

                                            self.ni[6] -= 0.0625
                                            if acc >= 8780:
                                                self.shang[6] -= 0.0625
                                                self.gou[6] -= 0.0625
                                                self.zi[6] -= 0.0625
                                                if acc >= 10151:
                                                    self.po[6] -= 0.0625
                                                
                                                    self.ni[6] -= 0.0625
                                                    self.cang[6] -= 0.0625
        # 秘籍奇穴套装
        if "橙武" in res["buff"]:
            self.xi[3] += 0.04977
            self.gou[3] += 0.04977
        if "武器·云水故·瑶枝[三阶]" in res["buff"]:
            self.xi[4] += 0.04977
        if "套装+技能伤害" in res["buff"]:
            self.xi[3] += 0.0996
            self.shang[3] += 0.0996


        if res["qixue_1"] == "1": # 川谷
            self.shang[3] += 0.0996
        if res["qixue_2"] == "1": # [鸩羽]
            self.xi[4] += 0.1
            self.xi[5] += 0.1
        if res["qixue_3"] == "3": # [岚因]
            self.zhan[3] += 0.1

        if "伤害+3%" in res["miji_shang"]:
            self.shang[3] += 0.03
        if "伤害+2%" in res["miji_shang"]:
            self.shang[3] += 0.02
        if "会心+4%" in res["miji_shang"]:
            self.shang[4] += 0.04
        if "会心+3%" in res["miji_shang"]:
            self.shang[4] += 0.03

        if "伤害+3%" in res["miji_gou"]:
            self.gou[3] += 0.03
        if "伤害+2%" in res["miji_gou"]:
            self.gou[3] += 0.02
        if "会心+4%" in res["miji_gou"]:
            self.gou[4] += 0.04
        if "会心+3%" in res["miji_gou"]:
            self.gou[4] += 0.03
        if "会心+2%" in res["miji_gou"]:
            self.gou[4] += 0.02

        if "伤害+3%" in res["miji_xi"]:
            self.xi[3] += 0.03
        if "伤害+2%" in res["miji_xi"]:
            self.xi[3] += 0.02
        if "会心+4%" in res["miji_xi"]:
            self.xi[4] += 0.04
        if "会心+3%" in res["miji_xi"]:
            self.xi[4] += 0.03

        if res["shangku"] == "3":
            # self.qie[3] += 2.8 #体服
            self.qie[3] += 1.2 #体服
        if "伤害+3%" in res["miji_qie"]:
            self.qie[3] += 0.03
        if "伤害+2%" in res["miji_qie"]:
            self.qie[3] += 0.02

        if "伤害+3%" in res["miji_yin"]:
            self.yin[3] += 0.03
        if "伤害+2%" in res["miji_yin"]:
            self.yin[3] += 0.02
        if "会心+5%" in res["miji_yin"]:
            self.yin[4] += 0.05
        if "会心+4%" in res["miji_yin"]:
            self.yin[4] += 0.04
    def print_obj(obj):
        print(obj.__dict__)